/* eslint-disable key-spacing */
import $ from 'jquery'
const t = localStorage.currentUser
  ? JSON.parse(localStorage.currentUser).token : ''

export default // {
//   dev_baseurl:"https://localhost:8080/",
//   test_baseurl:"http:///",
//   prod_baseurl:"https://java58.hf.java.com/",
function(url, data, f, e) {
  $.ajax({
    type: 'POST',
    // url: 'http://localhost:8080/' + url,
    url: 'http://47.98.223.132:8080/' + url,
    headers:{
      'Content-Type':'application/json;charset=UTF-8',
      'Authorization':'SANGE ' + t
    },
    // contentType: 'application/json;charset=utf-8',
    data: JSON.stringify(data),
    // dataType:"JSON",
    success: f,
    fail: function(data) {
      console.log(data.status)
    },
    error :e?e: function(data) {
      if (data.status === 403) {

      }
    }
  })
}
